package com.kim.seata.caller.server.controller;


import com.kim.seata.caller.server.service.IUserAccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 用户账户信息表 前端控制器
 * </p>
 *
 * @author KimWu
 * @since 2020-12-30
 */
@RestController
@RequestMapping("/userAccount")
public class UserAccountController {

    @Autowired
    private IUserAccountService userAccountService;

    /**
     * 模拟用户注册功能
     * ①本接口注册用户账户信息
     * ②调用用户信息服务，注册用户信息
     * addNoTxlcn  不带分布式事务
     * addTxlcn  不带分布式事务
     */


    @PostMapping("/addNoSeata")
    public String addNoSeata() {
        userAccountService.addNoSeata();
        return "ok";
    }

    @PostMapping("/addSeata")
    public String addSeata() {
        userAccountService.addSeata();
        return "ok";
    }

}
